package com.exception;

import com.vo.ResponseVO;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice //===ControllerAdvice+ ResponseBody
public class GlobalExceptionHandler {

    @ExceptionHandler(RuntimeException.class)
    public ResponseVO handleRuntime(RuntimeException re) {
        ResponseVO responseVO = new ResponseVO(500, re.getMessage(), null);
        return responseVO;
    }
}
